🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / repository / src / commonMain / kotlin / org / meshtastic / core / repository / PacketHandler.kt
Displaying Raw • Download
core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/PacketHandler.kt 4f86b91973784e4ec05b9a5c7b2dc396ed4848b8 (4f86b919) Text, 2.63 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.repository
Tff7b72import T7ee787org.meshtastic.proto.MeshPacket
Tff7b72import T7ee787org.meshtastic.proto.QueueStatus
Tff7b72import T7ee787org.meshtastic.proto.ToRadio
T8b949e/** Interface for handling the transmission of packets to the radio and managing the packet queue. */
Tff7b72interface T56d364PacketHandler Tb4b4b4{
T8b949e/** Sends a command/packet directly to the radio. */
Tff7b72fun Td2a8ffsendToRadioTb4b4b4(Te6edf3pTb4b4b4: Te6edf3ToRadioTb4b4b4)
T8b949e/** Adds a mesh packet to the queue for sending. */
Tff7b72suspend Tff7b72fun Td2a8ffsendToRadioTb4b4b4(Te6edf3packetTb4b4b4: Te6edf3MeshPacketTb4b4b4)
T8b949e/**
* Adds a mesh packet to the queue and suspends until its routing acknowledgement arrives.
*
* A successful [QueueStatus] only means that firmware accepted the packet into its transport queue; it does not
* prove that a self-addressed admin command has been processed. This stricter acknowledgement is required when a
* later packet depends on that command, such as installing a shared contact before sending the first DM.
*
* @return `true` on a routing ACK or synchronous local-loopback delivery (`ERRNO_SHOULD_RELEASE`); `false` when
* disconnected, transport sending fails, a routing NAK or queue rejection arrives, or the operation times out.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsendToRadioAndAwaitTb4b4b4(Te6edf3packetTb4b4b4: Te6edf3MeshPacketTb4b4b4)Tb4b4b4: Tffa657Boolean
T8b949e/** Processes queue status updates from the radio. */
Tff7b72fun Td2a8ffhandleQueueStatusTb4b4b4(Te6edf3queueStatusTb4b4b4: Te6edf3QueueStatusTb4b4b4)
T8b949e/** Removes and completes a pending response for a request before the caller's lifecycle lease is released. */
Tff7b72suspend Tff7b72fun Td2a8ffremoveResponseTb4b4b4(Te6edf3dataRequestIdTb4b4b4: Tffa657IntTb4b4b4, Te6edf3completeTb4b4b4: Tffa657BooleanTb4b4b4)
T8b949e/** Stops the packet queue. */
Tff7b72fun Td2a8ffstopPacketQueueTb4b4b4(Tb4b4b4)
T8b949e/**
* Re-arms the send-ACK timeout for every persisted packet still awaiting its routing ACK/NAK, so sends orphaned by
* a disconnect or app restart become retryable instead of showing as sending forever. Call once per connection,
* after the radio config is loaded.
*/
Tff7b72fun Td2a8ffrearmSendAckTimeoutsTb4b4b4(Tb4b4b4)
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s